package org.linlinjava.litemall.db.vo.marketing_manager;

import org.apache.commons.lang.StringUtils;

/**
 * @author houzb
 * @Description
 * @create 2021-08-28 17:41
 */
public class MarketingDeductionRuleInfo {
    /**
     * 规则id
     */
    private int id;
    /**
     * 规则名称
     */
    private String name;
    /**
     * 抵扣金类型
     */
    private String moneyType;
    /**
     * 抵扣金类型值
     */
    private int moneyTypeVal;
    /**
     * 规则状态
     */
    private String stat;
    /**
     * 状态类型值
     */
    private int statVal;
    /**
     * 结束时间
     */
    private String endTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMoneyType() {
        return moneyType;
    }

    public void setMoneyType(String moneyType) {
        this.moneyType = moneyType;
    }

    public int getMoneyTypeVal() {
        return moneyTypeVal;
    }

    public void setMoneyTypeVal(int moneyTypeVal) {
        this.moneyTypeVal = moneyTypeVal;
        this.moneyType = DeductionRuleTypeEnum.getTypeDescByVal(moneyTypeVal);
    }

    public String getStat() {
        return stat;
    }

    public void setStat(String stat) {
        this.stat = stat;
    }

    public int getStatVal() {
        return statVal;
    }

    public void setStatVal(int statVal) {
        this.statVal = statVal;
        this.stat = DeductionRuleStatEnum.getStatDescByVal(statVal);
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        if(StringUtils.isNotBlank(endTime)) {
            endTime = endTime.replaceAll("\\.0", "");
        }
        this.endTime = endTime;
    }
}
